<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>线下代理卡绑定</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="-2118390844">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "-2118390844";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("tbcardbinding.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建线下代理卡绑定"
  			,"inport":"导入线下代理卡绑定"
  			,"update":"修改线下代理卡绑定"
  			,"detail":"线下代理卡绑定详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#tbcardbindingForm").form({
		"":function(){}
		,"tbCardBinding.tbcbId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"tbCardBinding.tbcbBrand":function(el){
		}
		,"tbCardBinding.tbcbCard":function(el){
				if(el.value.length>10)
					return "数字太大了";
					 var pattern = /^-?(0|[1-9][0-9]*)?$/;
					 if(!pattern.test(el.value))
						return "请输入正确格式的数字";			
		}
		,"tbCardBinding.tbcbBindUser":function(el){
				if(el.value.length>10)
					return "数字太大了";
					 var pattern = /^-?(0|[1-9][0-9]*)?$/;
					 if(!pattern.test(el.value))
						return "请输入正确格式的数字";			
		}
		,"tbCardBinding.tbcbReCode":function(el){
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "充值码最大长度为32个字符";
		}
		,"tbCardBinding.tbcbQrCode":function(el){
			if(el.value.length>1024 && el.value.indexOf("[*]")==-1)
				return "二维码最大长度为1024个字符";
		}
		,"tbCardBinding.tbcbBindState":function(el){
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="TbCardBinding" id="tbcardbindingForm" name="tbcardbindingForm" target="jsoniframe" action="tbcardbinding.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt" style="display:none;">
				温馨提示：请仔细填写线下代理卡绑定相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("tbcbId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbId"))))}}
	{{lz.set("tbcbId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbId}}
	<dl lz:if="{{tbcbId_editable||tbcbId_readonly}}" class="tbcbId hidden " major  ref="tbcbId">
		<dt>编　　号:</dt>
		<dd lz:if="{{tbcbId_editable}}" input="hidden">
			<lz:block lz:if="{{tbCardBinding$tbcbId}}">
				{{tbCardBinding$tbcbId}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbId}}">
			<input type="hidden" value="{{lz.htm(tbCardBinding.tbcbId)}}" name="tbCardBinding.tbcbId" id="tbcbId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbId">{{tbCardBinding.tbcbId}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbId$||tbCardBinding.tbcbId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbId}}
	{{lz.set("tbcbBrand_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbBrand"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbBrand"))))}}
	{{lz.set("tbcbBrand_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbBrand}}
	<dl lz:if="{{tbcbBrand_editable||tbcbBrand_readonly}}" class="ribs tbcbBrand  " major  ref="tbcbBrand">
		<dt>品　　牌:</dt>
		<dd lz:if="{{tbcbBrand_editable}}" input="query">
			<lz:block lz:if="{{tbCardBinding$tbcbBrand}}">
				{{tbCardBinding$tbcbBrand}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbBrand}}">
		 			<input title="请输入品牌信息品牌名称进行查询" class="combox narrow" action="/admin/business/merchant.query.do?value={param}" type="text" id="tbcbBrand" name="tbCardBinding.tbcbBrand" text="{{lz.html(tbCardBinding.tbcbBrand$||tbCardBinding.tbcbBrand)}}" value="{{lz.htm(tbCardBinding.tbcbBrand)}}" />
		 			<a class="lookup" href="javascript:void(0);" onclick="if($.trim($('#tbcbBrand').val())==''){return;};window.href('/admin/business/merchant.detail.html?key='+$('#tbcbBrand').val())"></a>
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbBrand_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbBrand">{{tbCardBinding.tbcbBrand}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/business/merchant.details.html?key=tbCardBinding.tbcbBrand}')">
			 {{lz.html(tbCardBinding.tbcbBrand$||tbCardBinding.tbcbBrand)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbBrand}}
	{{lz.set("tbcbCard_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbCard"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbCard"))))}}
	{{lz.set("tbcbCard_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbCard}}
	<dl lz:if="{{tbcbCard_editable||tbcbCard_readonly}}" class="ribs tbcbCard  " major  ref="tbcbCard">
		<dt>线下代理卡:</dt>
		<dd lz:if="{{tbcbCard_editable}}" input="number">
			<lz:block lz:if="{{tbCardBinding$tbcbCard}}">
				{{tbCardBinding$tbcbCard}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbCard}}">
			<input onkeyup="var reg=/^-?(([1-9]\d{0,9})|0)?/;this.value=this.value.match(reg)?this.value.match(reg)[0]:''" type="text" class="input narrow"  maxlength="8" name="tbCardBinding.tbcbCard" id="tbcbCard"  value="{{lz.htm(tbCardBinding.tbcbCard)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入线下代理卡绑定的线下代理卡</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbCard_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbCard">{{tbCardBinding.tbcbCard}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbCard$||tbCardBinding.tbcbCard)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbCard}}
	{{lz.set("tbcbBindUser_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbBindUser"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbBindUser"))))}}
	{{lz.set("tbcbBindUser_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbBindUser}}
	<dl lz:if="{{tbcbBindUser_editable||tbcbBindUser_readonly}}" class="ribs tbcbBindUser  " major  ref="tbcbBindUser">
		<dt>绑定用户:</dt>
		<dd lz:if="{{tbcbBindUser_editable}}" input="number">
			<lz:block lz:if="{{tbCardBinding$tbcbBindUser}}">
				{{tbCardBinding$tbcbBindUser}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbBindUser}}">
			<input onkeyup="var reg=/^-?(([1-9]\d{0,9})|0)?/;this.value=this.value.match(reg)?this.value.match(reg)[0]:''" type="text" class="input narrow"  maxlength="8" name="tbCardBinding.tbcbBindUser" id="tbcbBindUser"  value="{{lz.htm(tbCardBinding.tbcbBindUser)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入线下代理卡绑定的绑定用户</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbBindUser_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbBindUser">{{tbCardBinding.tbcbBindUser}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbBindUser$||tbCardBinding.tbcbBindUser)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbBindUser}}
	{{lz.set("tbcbReCode_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbReCode"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbReCode"))))}}
	{{lz.set("tbcbReCode_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbReCode}}
	<dl lz:if="{{tbcbReCode_editable||tbcbReCode_readonly}}" class="ribs tbcbReCode  " major  ref="tbcbReCode">
		<dt>充 值 码:</dt>
		<dd lz:if="{{tbcbReCode_editable}}" input="text">
			<lz:block lz:if="{{tbCardBinding$tbcbReCode}}">
				{{tbCardBinding$tbcbReCode}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbReCode}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="tbCardBinding.tbcbReCode" id="tbcbReCode"  value="{{lz.htm(tbCardBinding.tbcbReCode)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入线下代理卡绑定的充值码</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbReCode_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbReCode">{{tbCardBinding.tbcbReCode}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbReCode$||tbCardBinding.tbcbReCode)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbReCode}}
	{{lz.set("tbcbQrCode_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbQrCode"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbQrCode"))))}}
	{{lz.set("tbcbQrCode_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbQrCode}}
	<dl lz:if="{{tbcbQrCode_editable||tbcbQrCode_readonly}}" class="ribs tbcbQrCode   mider" minor  ref="tbcbQrCode">
		<dt>二 维 码:</dt>
		<dd lz:if="{{tbcbQrCode_editable}}" input="text">
			<lz:block lz:if="{{tbCardBinding$tbcbQrCode}}">
				{{tbCardBinding$tbcbQrCode}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbQrCode}}">
		 	<input type="text" class="input mide"  maxlength="1024" name="tbCardBinding.tbcbQrCode" id="tbcbQrCode"  value="{{lz.htm(tbCardBinding.tbcbQrCode)}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请输入线下代理卡绑定的二维码</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbQrCode_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="tbcbQrCode">{{tbCardBinding.tbcbQrCode}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbQrCode$||tbCardBinding.tbcbQrCode)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbQrCode}}
	{{lz.set("tbcbBindState_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"tbcbBindState"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"tbcbBindState"))))}}
	{{lz.set("tbcbBindState_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$tbcbBindState}}
	<dl lz:if="{{tbcbBindState_editable||tbcbBindState_readonly}}" class="ribs tbcbBindState  " major  ref="tbcbBindState">
		<dt>绑定状态:</dt>
		<dd lz:if="{{tbcbBindState_editable}}" input="select">
			<lz:block lz:if="{{tbCardBinding$tbcbBindState}}">
				{{tbCardBinding$tbcbBindState}}
			</lz:block>
			<lz:block lz:if="{{!tbCardBinding$tbcbBindState}}">
		 	<select class="narrow" id="tbcbBindState" name="tbCardBinding.tbcbBindState">
		 		<option value="">请选择</option>
				<option value="0" selected='{{tbCardBinding.tbcbBindState=="0"?"selected":""}}'>未绑定</option>
				<option value="1" selected='{{tbCardBinding.tbcbBindState=="1"?"selected":""}}'>已绑定</option>
		 	</select>
	 	 </lz:block>
	 	 
	 	 <em>请选择线下代理卡绑定的绑定状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{tbcbBindState_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="tbcbBindState">{{tbCardBinding.tbcbBindState}}</textarea>
		 		<span>
		 	
			 {{lz.html(tbCardBinding.tbcbBindState$||tbCardBinding.tbcbBindState)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$tbcbBindState}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{tbCardBinding.tbcbId}}" name="tbCardBinding.tbcbId" id="tbcbId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/agents/tbcardbinding.edit.html?edittype=update&id={{tbCardBinding.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteTbcardbinding('{{tbCardBinding.id}}','{{tbCardBinding.tbcbId}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/agents/tbcardbinding.edit.html",document.title,"/admin/");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/agents/tbcardbinding.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除线下代理卡绑定
	**/
	function deleteTbcardbinding(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除线下代理卡绑定",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/agents/tbcardbinding.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>